package com.nineclock.doc.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.doc.dto.DocFileDto;
import com.nineclock.doc.service.StatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class StatusController {
    
    @Autowired
    StatusService statusService;
    
    @PutMapping("/{fileId}/{status}")
    public Result StatusController(@PathVariable("fileId") Long fileId, @PathVariable() Short status) {
        statusService.StatusController(fileId, status);
        return Result.success();
    }
    
    @PostMapping("/updateFile")     //内容
    public Result updateFile(@RequestBody DocFileDto docFileDto) {
        statusService.updateFile(docFileDto);
        return Result.success();
    }
    
    @GetMapping("/pagingCollaborations")
    public Result deletFilelis(@RequestParam("id") Long id) {
        statusService.deleteFiles(id);
        return Result.success();
    }
}
